package com.assignwork.vo;

import com.assignwork.entity.ThroughputForecastOre;
import com.assignwork.util.BigDecimalSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.Func;

import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;

/**
 * (ThroughputForecastOre)VO
 * @since 2024-05-07 15:21:28
 */
@Data
@ApiModel(value = "ThroughputForecastOreVO", description = "")
public class ThroughputForecastOreVO  {

    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    private String year;

    private String month;

    @ApiModelProperty(value = "四公司")
    @JsonSerialize(using = BigDecimalSerializer.class, nullsUsing = NullSerializer.class)
    private BigDecimal sgsTon;

    @ApiModelProperty(value = "煤")
    @JsonSerialize(using = BigDecimalSerializer.class, nullsUsing = NullSerializer.class)
    private BigDecimal mmtTon;

    @ApiModelProperty(value = "焦炭")
    @JsonSerialize(using = BigDecimalSerializer.class, nullsUsing = NullSerializer.class)
    private BigDecimal jtTon;

    @ApiModelProperty(value = "汇盛")
    @JsonSerialize(using = BigDecimalSerializer.class, nullsUsing = NullSerializer.class)
    private BigDecimal hsTon;

    @ApiModelProperty(value = "远航")
    @JsonSerialize(using = BigDecimalSerializer.class, nullsUsing = NullSerializer.class)
    private BigDecimal yhTon;

    public static List<ThroughputForecastOreVO> fromEtt(List<ThroughputForecastOre> ls) {
        return ls.stream().map(ThroughputForecastOreVO::fromEtt).collect(Collectors.toList());
    }

    public static ThroughputForecastOreVO fromEtt(ThroughputForecastOre ett) {
        return Func.copy(ett, ThroughputForecastOreVO.class);
    }
}

